#ifndef __STORMWIDGET_STORMWIDGET_UILIBRARY_ILIST_ILIST_H
#define __STORMWIDGET_STORMWIDGET_UILIBRARY_ILIST_ILIST_H


class CListHeaderUI;
class CListFooterUI;

#define UILIST_MAX_COLUMNS 10

typedef struct tagTListInfoUI
{
	int nColumns;
	RECT rcColumn[UILIST_MAX_COLUMNS];
	UITYPE_COLOR Text;
	UITYPE_COLOR Background;
	UITYPE_COLOR SelText;
	UITYPE_COLOR SelBackground;
	UITYPE_COLOR HotText;
	UITYPE_COLOR HotBackground;
	bool bExpandable;
} TListInfoUI;

class IListCallbackUI
{
public:
	virtual LPCTSTR GetImgItem(CControlUI* pList, int iItem) = 0;
	virtual LPCTSTR GetItemText(CControlUI* pList, int iItem, int iSubItem) = 0;
	virtual int CompareItem(CControlUI* pList, CControlUI* pItem1, CControlUI* pItem2) = 0;
};

class IListOwnerUI
{
public:
	virtual int GetCurSel() const = 0;
	virtual bool SelectItem(int iIndex) = 0;
	virtual void Event(TEventUI& event) = 0;
};

class IListUI : public IListOwnerUI
{
public:
	virtual CListHeaderUI* GetHeader() const = 0;
	virtual CListFooterUI* GetFooter() const = 0; 
	virtual CContainerUI* GetList() const = 0;
	virtual const TListInfoUI* GetListInfo() const = 0;
	virtual IListCallbackUI* GetTextCallback() const = 0;
	virtual void SetTextCallback(IListCallbackUI* pCallback) = 0;
	virtual bool ExpandItem(int iIndex, bool bExpand = true) = 0;
	virtual int GetExpandedItem() const = 0;
};

class IListItemUI
{
public:
	virtual int GetIndex() const = 0;
	virtual void SetIndex(int iIndex) = 0;
	virtual void SetOwner(CControlUI* pOwner) = 0;
	virtual bool IsSelected() const = 0;
	virtual bool Select(bool bSelect = true) = 0;
	virtual bool IsExpanded() const = 0;
	virtual bool Expand(bool bExpand = true) = 0;
	virtual void DrawItem(HDC hDC, const RECT& rcItem, UINT uStyle) = 0;
};

#endif //__STORMWIDGET_STORMWIDGET_UILIBRARY_ILIST_ILIST_H